package application;

import technicalservices.error.ErrorHandler;
import domain.general.Login;
import domain.users.User;

public class UserController {

	private User user = null;
	private Login login;
	
	public UserController() {
		login = new Login();
	}
	
	public void setUser(User user) {
		this.user = user;
	}
	
	public User getUser() {
		return user;
	}
	
	public boolean login(String email, String password) {
		user = login.authenticate(email, password);
		
		return (user != null);
	}

	public void logout() {
		user = null;
	}
	
	public void handleAccount() {
		ErrorHandler.getInstance().showError("Not yet implemented");
	}
	
	public void handleLeagueParticipation() {
		ErrorHandler.getInstance().showError("Not yet implemented");
	}
	
	public void handleTournamentParticipation() {
		ErrorHandler.getInstance().showError("Not yet implemented");
	}
	
}
